package com.aqiang.day0528_shop.main.api

import com.aqiang.day0528_shop.main.entity.*
import com.example.shopproject.usercenter.entity.TypeDataEntity
import com.zy.shopproject2.usercenter.entity.BaseResponseEntity
import kotlinx.coroutines.Deferred
import retrofit2.http.GET
import retrofit2.http.Query

interface MainApi {
    @GET("api/GoodsType/getRecommendTypes")
    fun getGoodsType():Deferred<BaseEntity<List<GoodsTypeEntity>>>

    @GET("api/Goods/getSeckilGoods?")
    fun spike(
        @Query("startTime") startTime:String,
        @Query("interval") interval:Int,
        @Query("page") page:Int,
        @Query("pagesize") pagesize:Int
    ):Deferred<BaseEntity<List<SpikeGoodsEntity>>>

    @GET("api/Goods/getGoods?")
    fun searchGoods(
        @Query("keyword") keyword:String,
        @Query("type") type:Int,
        @Query("pageno") pageno:Int,
        @Query("pagesize") pagesize:Int
    ):Deferred<BaseEntity<List<SearchGoodsEntity>>>

    @GET("api/GoodsType/getTypes?")
    fun getStair(@Query("parentId") parentId:Int):Deferred<BaseEntity<List<GoodsTypeEntity>>>

    @GET("api/GoodsType/getTypes?")
    fun getT(@Query("parentId") parentId:Int):Deferred<BaseEntity<List<NewEntity>>>

    @GET("api/BaseAddress/getAddress?")
    fun getArea(@Query("pid") pid:Int):Deferred<BaseEntity<List<AreaEntity>>>
}